﻿using System;
using System.Collections.Generic;
using T.FAS.Runtime.ScheduleJob.SPI;

namespace T.FAS.Runtime.ScheduleJob.SGSPI
{
    public interface IScheduleJobSGService
    {
        /// <summary>
        /// 恢复所有计划任务
        /// </summary>
        void ResumeAllJobs();
        /// <summary>
        /// 删除任务实例
        /// </summary>
        /// <param name="instanceID"></param>
        void DeleteJobInstance(string instanceID);
        /// <summary>
        /// 启动计划任务
        /// </summary>
        /// <param name="jobID"></param>
        void StartJobInstance(string jobID);
        /// <summary>
        /// 中止计划任务
        /// </summary>
        /// <param name="instanceID"></param>
        void PauseJobInstance(string instanceID);
        /// <summary>
        /// 恢复计划任务
        /// </summary>
        /// <param name="instanceID"></param>
        void ResumeJobInstance(string instanceID);
        /// <summary>
        /// 获取所有
        /// </summary>
        /// <returns></returns>
        List<ScheduleJobInstanceStore> GetAllActiveJobs();
        /// <summary>
        /// 获取计划任务执行信息
        /// </summary>
        /// <param name="instanceID"></param>
        /// <returns></returns>
        ScheduleJobExecuteInfo GetScheduleJobExecuteInfo(string instanceID);
        /// <summary>
        /// 运行时创建计划任务
        /// </summary>
        /// <param name="scheduleJob"></param>
        /// <returns></returns>
        Dictionary<string, string> CreateScheduleJob(Metadata.Entity.ScheduleJob.ScheduleJob scheduleJob);
    }
}
